﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IndustrialCommunication.Interfaces
{
    public interface INetMessage
    {
        /// <summary>
        /// 消息头长度
        /// </summary>
        int HeadBytesLength { get; }
        /// <summary>
        /// 消息头中定义的消息体的长度
        /// </summary>
        int ContentBytesLength { get; }
        /// <summary>
        /// 检查消息头是否符合协议
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        bool CheckHeadBytes(byte[] token);
        /// <summary>
        /// 消息头标识
        /// </summary>
        int HeadBytesIdentity { get; }
        /// <summary>
        /// 消息头
        /// </summary>
        byte[] HeadBytes { get; set; }
        /// <summary>
        /// 消息体
        /// </summary>
        byte[] ContentBytes { get; set; }
    }
}
